const express = require("express")
const {con,getMysql} = require('../../mysql/mysql.js'); 
const chat = express.Router() //创建路由


//获取用户信息
chat.get("/chats",async (req,res)=>{
    let {id}=req.query
    let str=`select * from user`
    let data=await getMysql(str)
    // console.log(data[0].author)
    res.send({data:data})
})


//跟新用户信息
chat.get("/chat",async (req,res)=>{
    let {id}=req.query
    let str=`select * from user`
    let data=await getMysql(str)
    // console.log(data[0].author)
    res.send({data:data})

})

module.exports = chat

